/**
 * 
 */
package com.sci.web.action.lefttree;

import java.util.ArrayList;
import java.util.List;

import com.opensymphony.xwork2.ActionContext;
import com.sci.web.action.util.BaseAction;
import com.sci.web.bean.Menu;
import com.sci.web.bean.Permission;

/**
 * @author  BaiFuyou
 * @date: Sep 23, 2011 2:37:51 PM
 * 创新型企业数据分析
 */
public class CxxqysjfxTreeAction extends BaseAction {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1691730796313081804L;

	@Override
	public String execute() throws Exception {
		// TODO Auto-generated method stub
		List<Menu> menu = new ArrayList<Menu>();
		Menu sdqysjfx = new Menu("sdqysjfx","试点企业数据分析",true,"partSMLModeing_sml","试点企业数据分析");
		Menu sfqysjfx = new Menu("sfqysjfx","示范企业数据分析",true,"partSMLModeing_sml","示范企业数据分析");
		Permission p = (Permission) ActionContext.getContext().getSession().get("permission");
		int uc = (Integer) ActionContext.getContext().getSession().get("uc");
		int ur = (Integer) ActionContext.getContext().getSession().get("ur");
		if(uc == -1 && ur == -1){
			menu.add(sdqysjfx);
			menu.add(sfqysjfx);
			String json = super.getJSONArrayString(menu);
			super.setContentType(BaseAction.JSON);
			super.outPrint(json);
			return "json";
		}
		if(p.getSfqysjfx() == 1){
			menu.add(sfqysjfx);
		}
		if(p.getSdqysjfx() == 1){
			menu.add(sdqysjfx);
		}
		String json = super.getJSONArrayString(menu);
		super.setContentType(BaseAction.JSON);
		super.outPrint(json);
		return "json";
	}

}
